package model

import (
	"gitee.com/xuxinzhi2206/corehub/database/mysql"
	"gorm.io/gorm"
)

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(100);comment:用户名"`
	Password string `gorm:"type:varchar(100);comment:密码"`
	Mobile   string `gorm:"type:varchar(100);comment:手机号"`
}

func (u *User) Create() error {
	return mysql.WithMysql(func(db *gorm.DB) error {
		return db.Create(u).Error
	})
}
